home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
151-175
/
scopedisk158
/
muchppacker
/
mminput.asm
< prev
next >
Wrap
Assembly Source File
|
1995-03-19
|
2KB
|
63 lines
;-------------------------------------------------------------------------
;MuchMore's InputHandler
;© 1989 by Fridtjof Siebert
;compiles with a68k
;-------------------------------------------------------------------------
XDEF MMInputHandler ; Then Handler Procedure
XDEF WakeUpSignal ; Signal to be send to awake MuchMore (byte)
XDEF SigTask ; TaskPtr to MuchMore's main task
XDEF Sleeping ; true while waiting for alt-ESC
ie_nextevent = 0;
ie_class = 4;
ie_subclass = 5;
ie_code = 6;
ie_qualifier = 8;
Signal = -30-294;
; InputData: STRUCT
; wakeUpSignal: SHORTINT; (* Signal that's wakes us up*)
; sigTask: e.TaskPtr; (* MM's main task *)
; sleeping: BOOLEAN; (* TRUE while we sleep *)
; END;
; offsets in InputData
WakeUpSignal = 0;
SigTask = 2;
Sleeping = 6;
MMInputHandler:
move.l A3,-(A7); we'll use A3
move.l A0,-(A7); presave eventlist;
move.l A1,A3; save pointer to InputData
tst.b Sleeping(A3);
beq.s rts;
loop: cmp.b #$10,ie_qualifier+1(A0); test if lAlt is set end rest is clear
bne next;
cmp.w #$45,ie_code(A0); test ESC
bne.s next;
clr.w ie_code(A0);
move.l $4,A6;
move.l SigTask(A3),A1;
moveq #0,D0;
move.b WakeUpSignal(A3),D1;
bset D1,D0;
jsr Signal(A6);
sf Sleeping(A3);
bra.s rts;
next: move.l ie_nextevent(A0),A0;
move.l A0,D0;
bne.s loop;
rts: move.l (A7)+,D0; return EventList
move.l (A7)+,A3; restore A3
rts;
end;